home *** CD-ROM | disk | FTP | other *** search
/ MacTest Pro 1998 December / MacTestPro-Dec1998.iso / Utilities / System Utilities / Network Server 500⁄700 / Open Firmware Read Me < prev   
Encoding:
Text File  |  1996-09-05  |  18.6 KB  |  587 lines  |  [ttro/ttxt]

  1.  
  2.  
  3.  
  4. About Open Firmware for the Network Server 
  5.  
  6.  
  7. Contents
  8.  
  9. • Introduction
  10. • Starting Up Open Firmware
  11. • Using Open Firmware
  12. • Open Firmware Command Summary
  13.  
  14. Introduction
  15.  
  16. Open Firmware provides features that enable you to access low-level 
  17. information about your Network Server. Using Open Firmware, for example, 
  18. you may examine settings stored in the server's non volatile memory 
  19. (NVRAM). 
  20.  
  21. Open Firmware is a standard software architecture for controlling a 
  22. computer before the operating system begins execution. The complete 
  23. specification for the Open Firmware standard is defined in the IEEE standard 
  24. document IEEE P1275-1994 Standard for Boot Firmware. The Open Firmware 
  25. software orchestrates how the hardware loads the operating system and 
  26. defines which properties (or features) of the hardware are available for use 
  27. by the operating system. The Open Firmware command language is based on 
  28. Forth. 
  29.  
  30. For the latest version of Open Firmware software and  documentation, click the 
  31. Network Server button at the World Wide Web site 
  32. http:/www.solutions.apple.com. 
  33.  
  34. Starting Up Open Firmware
  35.  
  36. To start up Open Firmware, hold down these keys while the server is 
  37. restarting:
  38.  
  39.   Command-Option-O-F
  40.  
  41. Enter Open Firmware commands at the >ok prompt. Separate each command 
  42. by one or more spaces. A summary of general commands available in this 
  43. implementation of the IEEE standard is provided at the end of this section. 
  44.  
  45. Using Open Firmware
  46.  
  47. These commands provide low-level information about your Network Server:
  48.  
  49. printenv
  50. Displays configuration settings stored in NVRAM. For example, 
  51. one configuration setting specifies the boot path for the 
  52. operating system. This setting is named boot-device. There is 
  53. also a setting named diag-device which identifies the boot path 
  54. for loading diagnostics when the server key switch is in the left 
  55. (service) position.
  56.  
  57.     The configuration setting name appears in the left column, the 
  58. current setting appears in the middle column, and the default 
  59. setting is in the right column. Use the set-default command to 
  60. restore default settings when appropriate. If you encounter 
  61. difficulties starting up the Network Server operating system, 
  62. try setting defaults. Also, you should copy down the current 
  63. settings after you install the operating system. If you later 
  64. experience problems starting up the operating system, you can 
  65. use printenv to check the settings using this command to 
  66. determine verify the configuration settings. 
  67.  
  68. devalias
  69. Displays name aliases to devices stored as properties in the 
  70. device tree. A name alias is an abbreviated way of referring to 
  71. a device path name. For example, to boot the Network Server 
  72. Diagnostic Utility, you specify the name alias for the floppy 
  73. drive, fd: 
  74.  
  75.                      boot fd:diags
  76.  
  77. probe-scsi1
  78. Searches the Fast and Wide SCSI bus 0 and for each device 
  79. attached displays the SCSI ID, the type of device, and other 
  80. pertinent information such as the device's firmware version 
  81. number. Use this command to verify that the devices in the top 
  82. four drive trays are correctly recognized by the Network 
  83. Server.
  84.  
  85. probe-scsi2
  86. Searches the Fast and Wide SCSI bus 1 and for each device 
  87. attached displays the SCSI ID, the type of device, and other 
  88. pertinent information such as the device's firmware version 
  89. number. Use this command to verify that the devices in the 
  90. bottom four drive trays and the two rear bracket-mounted 
  91. internal drives (Network Server 700 only) are correctly 
  92. recognized by the Network Server.
  93.  
  94. dump-device-tree
  95. Displays the device tree, which lists all features and 
  96. devices in the Network Server encoded into a specific data 
  97. format. Use the spacebar to control scrolling of the list.
  98.  
  99. The following command are used to change configuration settings stored in 
  100. NVRAM. The name-alias variable is  the setting name. The value variable 
  101. can be a number, logical name (true, false), or a sequence of text.
  102.  
  103. setenv name-alias value 
  104. Use this command to change the specified 
  105. configuration setting to the indicated value. For example, to change the OS boot device:
  106.     
  107.     setenv boot-device disk3:aix        
  108.  
  109. This adds disk 6 to the boot search path:
  110.  
  111.     setenv diag-device cd disk6 fd:diags
  112.  
  113. set-default name-alias 
  114. This command restores the default of the named 
  115. configuration setting. This example restores the boot device setting to disk2:aix: 
  116.  
  117.     set-default boot-device     
  118.  
  119.     This command restores the default diagnostic device to disk2:aix:
  120.  
  121. set-default diag-device
  122.  
  123. set-defaults
  124. Restores the factory defaults for all the configuration settings.
  125.  
  126. Configuration Settings to Check in Case of Problems
  127.  
  128. If you encounter problems when the operating system starts up, check these 
  129. configuration settings:
  130.  
  131. auto-boot?
  132. Must be true in order to enable automatic booting of the 
  133. operating system or the diagnostics when the key switch is the 
  134. in the service position.
  135.  
  136. load-base
  137. The Network Server Diagnostic Utility expects this number to be 
  138. 4000 or greater.
  139.  
  140. diag-device
  141. In order to be able to boot the Network Server Diagnostic 
  142. Utility from the floppy drive, the value of diag-device must 
  143. include fd:diags. Any device preceding fd:diags must be 
  144. unmounted or removed. For example, the default setting for 
  145. diag-device is cd fd:diags. This means that the search order for 
  146. a bootable device begins with the CD-ROM drive and proceeds to 
  147. the floppy drive only if the CD-ROM drive does not contain a 
  148. bootable CD. You must remove the CD-ROM disk in this case in 
  149. order to boot the floppy drive.
  150.  
  151. boot-device
  152. The factory default for booting the operating system is disk2 
  153. or the hard drive contained in drive tray three (Fast and Wide 
  154. bus 0 SCSI ID 2). If this value becomes corrupt or changes, 
  155. the AIX operating system won’t boot. If you are 
  156. unable to restore this setting to the default or you cannot 
  157. change the setting with the setenv boot-device command, then 
  158. you may still be able to boot AIX by manually entering the boot 
  159. command:    boot disk2:aix
  160.  
  161.     Open Firmware Command Summary
  162.  
  163. Command         Stack          Comment
  164.  
  165. Changing the Number Base & Number Input/Output Commands
  166.  
  167. decimal         ( -- )            Set the number base to 10.
  168.  
  169. d# number    ( -- n)           Interpret the next number in decimal.
  170.  
  171. hex             ( -- )            Set the number base to 16.
  172.  
  173. h# number    ( -- n)           Interpret the next number in hex.
  174.  
  175. u.              (n -- )           Display the unsigned number.
  176.  
  177. .d              (n -- )           Display n in decimal without 
  178.                             changing number base system.
  179.  
  180. .h              (n -- )           Display n in hex without changing base.
  181.  
  182. .               (n -- )           Display a number in the Current base.
  183.  
  184. .s              ( -- )            Display contents of data stack.
  185.  
  186. Memory Access Commands
  187.  
  188. !            (n adr16 -- )        Store a 32-bit Number at adr16,
  189.                                   16-bit aligned.
  190.  
  191. @            (adr16 -- n )        Fetch a 32-bit Number from adr16.
  192.  
  193. c!           (n adr -- )          Store low byte of n at adr.
  194.  
  195. c@           (adr -- n )          Fetch a byte from adr.
  196.  
  197. cpeek    (adr -- [byte] ok?)      Fetch the byte at adr.Return the data 
  198.                                   and true if the read access was
  199.                                   successful. Return false if an error     
  200.                                   occurred.
  201.  
  202. cpoke    (byte adr -- ok?)        Store the byte to adr.
  203.                                   Return true if the write access was
  204.                                   successful. Return false if an error     
  205.                                   occurred.
  206.  
  207. comp    (adr1 adr2 len -- n)   Compare two byte arrays, n=0 if
  208.                                   arrays are identical, n=1 if first byte
  209.                                   that is different is greater in array#1,
  210.                                   n= -1 otherwise.
  211.  
  212. dump        (adr len -- )         Display len bytes of memory from adr.
  213.  
  214. fill     (adr size byte -- )   set size bytes of memory to byte.
  215.  
  216. l!         (n adr32 -- )          Store a 32-bit number at adr32, 32-bit 
  217.                                   aligned.
  218.  
  219. l@          (adr32 -- n)          Fetch a 32-bit number from adr32.
  220.  
  221. lpeek    (adr -- [long] ok?)   Like cpeek, but 32-bit access.
  222.  
  223. lpoke     (long adr -- ok?)       Like cpoke, but 32-bit access.
  224.  
  225. move      (adr1 adr2 n -- )       Copy n bytes from adr1 to adr2.
  226.  
  227. w!         (n adr16 -- )          Store a 16-bit number at adr16.
  228.  
  229. w@          (adr16 -- n)          Fetch a 16-bit number from adr16.
  230.  
  231. wpeek    (adr -- [word] ok?)      Like cpeek, but 16-bit access.
  232.  
  233. wpoke     (word adr -- ok?)       Like cpoke, but 16-bit access.
  234.  
  235. Memory Mapping Commands            
  236.  
  237. do-map    (phys virt size mode -- )Map a region of 32-bit physical
  238.                                       address at phys to a region of 32-bit 
  239.                                       virtual address at virt, the mode is 0 for 
  240.                                       Memory and 0x28 for input/output normally. 
  241.                                       Open Firmware turns on MMU translation and 
  242.                                       uses virtual address for Memory and I/O 
  243.                                       access. The physical addr has to be mapped 
  244.                                       before access. The mapping table can be 
  245.                                       seen from the property 'translations' under 
  246.                                       the cpu node '/PowerPC,601' or         
  247.                                       '/PowerPC,604'. eg. fa000000 dup 1000 28 
  248.                                       do-map
  249.  
  250. do-unmap    ( virt size -- )          Unmap the previous mapped 
  251.                                       region.
  252.  
  253. PCI Registers Access Commands
  254.  
  255. rb!            (n adr -- )            Store low byte of n at adr.
  256.  
  257. rb@            (adr -- n)             Fetch a byte from adr.
  258.  
  259. rl!           (n adr32 -- )           Store a 32-bit number at adr32,
  260.                                       32-bit aligned.
  261.  
  262. rl@           (adr32 -- n )           Fetch a 32-bit number from adr32.
  263.  
  264. rw!           (n adr16 -- )           Store a 16-bit number at adr16.
  265.  
  266. rw@           (adr16 -- n )           Fetch a 16-bit number from adr16.
  267.  
  268. NOTE:    For big endian registers use xb!, xb@, xl!, xl@,
  269. rw!, rw@ instead. If the (big endian) register access doesn't 
  270. require special instruction such as eieio, it may use c!, c@, 
  271. l!, l!, w!, w@.
  272.  
  273. Stack Manipulation Commands
  274.  
  275. bounds    (start-adr size -- end-adr start-adr) 
  276. This is equal to:over + swap
  277.  
  278. 2drop    (n1 n2 -- )    
  279. Remove two items from the stack.
  280.  
  281. 2dup    (n1 n2 -- n1 n2 n1 n2) 
  282. Duplicate two items.
  283.  
  284. clear    (??? -- )    
  285. Empty the stack.
  286.  
  287. drop    (n -- )    
  288. Remove one item from the stack.
  289.  
  290. dup    (n -- n n)    
  291. Duplicate the top stack item.
  292.  
  293. over    (n1 n2 -- n1 n2 n1)    
  294. Copy the second item to the top.
  295.  
  296. rot    (n1 n2 n3 -- n2 n3 n1)
  297. Rotate three stack items.
  298.  
  299. swap    (n1 n2 -- n2 n1)     
  300. Exchange the top two items.
  301.  
  302. Arithmetic Commands
  303.  
  304. *    (n1 n2 -- n3)            Multiply n1 * n2
  305.  
  306. +    (n1 n2 -- n3)            Add n1 + n2
  307.  
  308. -    (n1 n2 -- n3)         Subtract n1 - n2
  309.  
  310. /    (n1 n2 -- n3)         Divide n1 / n2 (truncated)
  311.  
  312. <<    (n1 n2 -- n3)           Left shift n1 by n2 bits
  313.  
  314. >>    (n1 n2 -- n3 )          Right shift n1 by n2 bits
  315.  
  316. and    ( n1 n2 -- n3)         Bitwise logical and
  317.  
  318. mod    (n1 n2 -- n3)          Remainder of n1 / n2
  319.  
  320. not    (n1 -- n2)             Bitwise logical inversion
  321.  
  322. or    (n1 n2 -- n3)           Bitwise logical or
  323.  
  324. xor    (n1 n2 -- n3)          Bitwise logical exclusive or.
  325.  
  326. Examining and Creating Device Aliases
  327.  
  328. devalias                               Display all current device aliases.
  329.  
  330. devalias <alias>                       Display the device path name         
  331.                                           corresponding to <alias>.
  332.  
  333. devalias <alias> <device-pathname>     Define an <alias> representing
  334.                                           the <device-pathname>.
  335.  
  336. Device Tree Browsing Commands
  337.    
  338. dump-device-tree                       Dump the whole system device tree.
  339.  
  340. .properties                            Display the names and values of the
  341.                                           current device node's properties.
  342.  
  343. dev <device-pathname>                  Select the indicated device node,
  344.                                           making it the current node.
  345.  
  346. dev <node-name>                        Search for a node with given name in the 
  347.                                           subtree below the current node, and     
  348.                                           choose the first such node found.
  349.  
  350. dev ..                                    Choose the device node that is the parent 
  351.                                           of the current node.
  352.  
  353. dev /                                     Choose the root machine node.
  354.  
  355. show-devs <device-pathname>            Display all the devices directly
  356.                                           beneath the given device. For example,
  357.                                                 show-devs /bandit
  358.  
  359. device-end                             Leave no node selected.
  360.  
  361. ls                                        Display children of the current node.
  362.  
  363. pwd                                       Display the current device path name.
  364.  
  365. words                                     Display the names of the current node’s 
  366.                                           methods.
  367.  
  368. select-dev (str,len -- )               Select the desired device node in order 
  369.                                           to execute the device methods under it. 
  370.                                           This requires all nodes of the desired 
  371.                                           device path have open method.
  372.  
  373. unselect-dev                           Unselect the previous selected device 
  374.                                           node.
  375.  
  376. If-then-else Commands
  377.    
  378. else    ( -- )                            Execute the following code if 'if'     
  379.                                           failed.
  380.  
  381. if    (flag -- )                          Execute the following code if flag is true.
  382.  
  383. then    ( -- )                            Terminate if ... then ... else.
  384.  
  385. Begin (conditional) Loop Commands
  386.  
  387. again    ( -- )                           End a begin ... again infinite loop.
  388.  
  389. begin    ( -- )                           Begin a begin ... while ... repeat,
  390.                                           begin ... until, or begin ... again loop.
  391.  
  392. repeat    ( -- )                          End a begin ... while ... repeat loop.
  393.  
  394. until    (flag -- )                       Continue executing a begin ... until loop
  395.                                           until flag is true.
  396.  
  397. while    (flag -- )                       Executing a begin ... while ... repeat
  398.                                           loop while flag is true.
  399.  
  400. Do (Counted) Loop Commands
  401.  
  402. +loop    (n -- )                          End a do ... +loop construct; add n to
  403.                                           loop index and return to do (if n < 0,
  404.                                           index goes from start to end inclusive).
  405.  
  406. do    (end start -- )                     Begin a do ... loop. Index goes from
  407.                                           start to end-1 inclusive. Example:
  408.                                              10 0 do i . loop
  409.  
  410. i    ( -- n)                              Loop index.
  411.  
  412. j    ( -- n)                              Loop index for next enclosing loop.
  413.  
  414. leave    ( -- )                           Exit from do ... loop.
  415.  
  416. loop    ( -- )                            End of do ... loop.
  417.  
  418.  
  419. Comparison Commands
  420.  
  421. <       (n1 n2 -- flag)    True if n1 < n2.
  422. <=      (n1 n2 -- flag)    True if n1 <= n2.
  423. <>      (n1 n2 -- flag)    True if n1 <> n2.
  424. =       (n1 n2 -- flag)    True if n1 = n2.
  425. >       (n1 n2 -- flag)    True if n1 > n2.
  426. >=      (n1 n2 -- flag)    True if n1 >= n2.
  427.  
  428.  
  429. Controlling Text Input Commands & Display Text Output Commands
  430.  
  431. ascii <c>( -- n)    
  432. Get numerical value of first ASCIIcharacter of next word.
  433.  
  434. key    ( -- char)
  435. Read a character from the assigned input device's keyboard.
  436.  
  437. key?    ( -- flag)    
  438. True if a key has been typed on the input device's keyboard.
  439.  
  440. cr    ( -- )
  441. Go to the next line on the display.
  442.  
  443.  
  444. File Loading Commands
  445.  
  446. boot [specifiers]    
  447. Boot file from specified source.
  448.  
  449. dl        
  450. Load a Forth file over a serial line.
  451.  
  452. init-program    
  453. Initialize to execute a binary file.
  454.  
  455. load [specifiers]    
  456. Load data from specified device.
  457.  
  458. NOTE: Use boot (or load) one of these four ways:
  459.  
  460. (1) boot
  461. (2) boot <device-specifier>
  462. (3) boot <arguments>
  463. (4) boot <device-specifier> <arguments>
  464.  
  465. NOTE: When using the floppy drive (name-alias is fd), the disk must 
  466. be high density 1.4 MB formatted for the MacOS or DOS environments.
  467.  
  468.  (1) For a MacOS floppy, <device-specifier> is fd:<filename>
  469.  (2) For a DOS floppy, <device-specifier> is  fd:,<filename>
  470.  
  471. Defining Words
  472.  
  473. : <name>( -- )        Start creating a new command word.
  474. ;    ( -- )              Finish creating the new word.
  475.  
  476. Manipulating Text Strings
  477.  
  478. " <string>"( -- adr len )    Collect an input string.
  479.  
  480. Redirecting I/O
  481.  
  482. input    (device-str -- )    
  483. Select the indicated device for console input, device may be a device name-alias. 
  484.  
  485. io    (device-str -- )    
  486. Select device for subsequent input and output. Eg.  ttyb:9600
  487.  
  488. output    (device-str -- )    
  489. Select the indicated device for console output. Eg.  screen output
  490.  
  491. Emergency Keyboard Commands
  492.  
  493. NOTE: Hold down keys during Open Firmware power on sequence.
  494.  
  495. Command-Option-O-F    Abort auto booting if auto-boot? is true.
  496. Command-Option-P-R    Reset NVRAM contents to default values.
  497.  
  498. PowerPC Register Commands
  499.  
  500. %r0  through  %r31 ( -- value)Return saved copy of the given register.
  501.  
  502. %srr0 & %srr ( -- value)    Return saved copy of Save/Restore reg.
  503.  
  504. %sprg0 through %sprg3( -- value) Access saved copies of SPRG registers.
  505.  
  506. %cr    ( -- value)    Return saved copy of Condition Register.
  507.  
  508. %ctr    ( -- value)    Return saved copy of Counter Register.
  509.  
  510. %lr    ( -- value)    Return saved copy of Link Register.
  511.  
  512. %xer    ( -- value)    Return saved copy of XER register.
  513.  
  514. msr@    ( -- value)    Return current value of Machine State Register.
  515.  
  516. msr!    (value --)    Set new value of Machine State Register.
  517.  
  518. sprg3@    ( -- value)    Get current interrupt vector pointer.
  519.  
  520. sprg3!    ( value --)    Set our interrupt vector pointer.
  521.  
  522. .registers    Display the PowerPC CPU’s saved program state.
  523.  
  524. Miscellaneous Operation Commands
  525.  
  526. eject [fd]    
  527. Eject the floppy disk from the drive.
  528.  
  529. get-msecs ( -- ms )    
  530. Return the approximate current time in milliseconds.
  531.  
  532. ms    ( n -- )    
  533. Delay for n milliseconds. Resolution is 1 millisecond.
  534.  
  535. reset-all    
  536. Reset the entire system (similar to a power cycle).
  537.  
  538. NVRAMRC Editor Commands
  539.  
  540. nvalias <alias> <Device-pathname> 
  541. Store the command "devalias <alias> <Device-pathname>" in NVRAMRC. (The alias persists until the nvunalias or set-defaults commands are executed or NVRAM is 
  542. reset.)
  543.  
  544. nvedit        
  545. Enter the NVRAMRC editor. If data remains in the temporary buffer from a previous 
  546. nvedit session, resume editing the previous contents. If not, read the contents of NVRAMRC into the temporary buffer and begin editing it. 
  547.  
  548. nvquit        
  549. Discard the contents of the temporary buffer without writing it to NVRAMRC.
  550.  
  551. nvrecover    
  552. Recover the contents of NVRAMRC if they have been lost
  553.  
  554. nvrun        
  555. Evaluate the temporary buffer.
  556.  
  557. nvstore        
  558. Copy the contents of the temporary buffer to NVRAMRC; discard the contents of the 
  559. temporary buffer.
  560.  
  561. nvunalias <alias>    
  562. Delete the corresponding alias from     NVRAMRC.
  563.  
  564. ^c        (Control-C) Quit nvedit and get back to the ok prompt.
  565.  
  566.  
  567. ©  1996 Apple Computer, Inc. All rights reserved. Apple and the Apple logo 
  568. are trademarks of Apple Computer, Inc., registered in the United States and 
  569. other countries. Mac is a are trademark of Apple Computer, Inc.
  570.  
  571. AIX is a trademark of IBM Corporation, registered in the United States and 
  572. other countries, and is being used under license
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.